package team.hyznrj.studentsys.controller;

import java.util.List;
import java.util.function.Predicate;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import io.swagger.annotations.Api;
import team.hyznrj.studentsys.dao.mapper.QualityTypeMapper;
import team.hyznrj.studentsys.dto.QualityAchievementDto;
import team.hyznrj.studentsys.dto.StudentMessageSearchDto;
import team.hyznrj.studentsys.entity.DataReport;
import team.hyznrj.studentsys.entity.QualityAchievement;
import team.hyznrj.studentsys.entity.QualityType;
import team.hyznrj.studentsys.enums.DataBaseOperateMethod;
import team.hyznrj.studentsys.enums.DataReportEnum;
import team.hyznrj.studentsys.exception.AuthenticationOnFlagException;
import team.hyznrj.studentsys.exception.DataBaseOperationError;
import team.hyznrj.studentsys.exception.DataNullException;
import team.hyznrj.studentsys.service.ExcelService;
import team.hyznrj.studentsys.service.FileService;
import team.hyznrj.studentsys.service.QualityAchievementService;
import team.hyznrj.studentsys.service.QualityTypeService;
import team.hyznrj.studentsys.utils.ReadExcel;

@RestController
@RequestMapping("QualityType")
@Api(value = "QualityType")
public class QualityTypeController {
	@Autowired
	QualityTypeService service;
	@ResponseBody
	@RequestMapping(value = "/getType", method = { RequestMethod.POST }, produces = "application/json;charset=utf-8")
	public Object getType() throws DataNullException, DataBaseOperationError, AuthenticationOnFlagException {
		List<QualityType> allType = service.getAllType();
		return new DataReport(DataReportEnum.SUCCESS, null, allType, true);
	}

}
